Delete junk tools.
3e6377dbGcgnisKw16DPCaND7oGO3Q tools/balloon/balloon.c
401d7e160vaxMBAUSLSicuZ7AQjJ3w tools/examples/Makefile
401d7e16UgeqroJQTIhwkrDVkoWgZQ tools/examples/README
-40083bb4_j61quzxosgZ19LUgLlgYw tools/examples/add_vbd_to_dom.py
-3fbe2f12OPAkzIUtumU3wRAihnhocQ tools/examples/createlinuxdom.py
401d7e16GS8YesM1zateRbaOoI6YLQ tools/examples/defaults
401d7e16NoWaBGC1RXbBcqAOr5Uaag tools/examples/democd
-3fbe2f12dZbmXLlgQdMgkmnSUj23AQ tools/examples/destroydom.py
-40083bb4lxCIf5HRu6fwWUyHCYOHKA tools/examples/list_vbds.py
-3fbe2f12ltvweb13kBSsxqzZDAq4sg tools/examples/listdoms.py
-3fca7700PVj36cZObaFZlQicRiw1pQ tools/examples/pincpu.py
-3fd8bc48ww3aOqPhYjCr8KGulG0NQQ tools/examples/readxenconsolering.py
-40083bb4zWkCUTHJKd1ApEOoPAuihg tools/examples/remove_vbd_from_dom.py
-3fccbe068ov0YCxnk-2m4law19QMmA tools/examples/startdom.py
-3fbe2f12Bnt8mwmr1ZCP6HWGS6yvYw tools/examples/stopdom.py
-40083bb4LeyQyL-0riaV3UYDfHkl5g tools/examples/vd_create.py
-40083bb4TmKs8pcFkOcJj1bKn3zcmg tools/examples/vd_delete.py
-40083bb4u9Od6ujgect6mrxWfkk1pQ tools/examples/vd_format.py
-400c33000SvWkdG92u4Bvdu6BPjGPw tools/examples/vd_freespace.py
-400c3300jb_Ufz2kWsovGKNoDPEf-A tools/examples/vd_list.py
-400c774eVfeVCkLn34s-Lh4-6jBXWw tools/examples/vd_read_from_file.py
-40083bb4NhDpKiYTrebI3ZjX__oI_w tools/examples/vd_refresh.py
-400c774eXs8hWKK70ZYzi1ScKiSjPQ tools/examples/vd_to_file.py
-400c33001-uDKTfHBchTKUwuMFcqTA tools/examples/vd_undelete.py
401d7e16NpnVrFSsR7lKKKfTwCYvWA tools/examples/xc_dom_control.py
401d7e16RJj-lbtsVEjua6HYAIiKiA tools/examples/xc_dom_create.py
401d7e16X4iojyKopo_j63AyzYZd2A tools/examples/xc_vd_tool.py
3f13d81eQ9Vz-h-6RDGFkNR9CRP95g tools/misc/xen_nat_enable
3f13d81e6Z6806ihYYUw8GVKNkYnuw tools/misc/xen_nat_enable.README
3f1668d4F29Jsw0aC0bJEIkOBiagiQ tools/misc/xen_read_console.c
-3f87ba90EUVPQLVOlFG0sW89BCwouQ tools/misc/xen_refresh_dev.c
3fbca441SjQr8vJwTQIgH1laysaWog tools/xc/Makefile
3fbba6dbDfYvJSsw9500b4SZyUhxjQ tools/xc/lib/Makefile
3fbba6dc1uU7U3IFeF6A-XEOYF2MkQ tools/xc/lib/rpm.spec
+++ /dev/null
-#!/usr/bin/env python
-
-# Used to map a VBD into a domain's device space. Useful for populating a new
-# VBD with data from DOM0 before starting a new domain using it, for instance.
-
-import Xc, XenoUtil, sys
-
-XenoUtil.VBD_EXPERT_LEVEL = 0 # sets the allowed level of potentially unsafe mappings
-
-def usage():
- print >>sys.stderr,"""Usage: add_vdisk_to_dom.py uname target-dev target-dom [perms]
- uname - the uname of the source device, e.g. vd:2341 or phy:hda3
- target-dev - the device node to map the VBD to
- target-dom - domain to add the new VBD to
- perms - optionally specify 'r', or 'rw' (default is 'r')
- """
- sys.exit(1)
-
-xc = Xc.new()
-
-if not 4 <= len(sys.argv) <= 5:
- print len(sys.argv)
- usage()
-
-writeable = 0
-
-if len(sys.argv) == 5:
- if sys.argv[4] == 'rw':
- writeable = 1;
- else:
- if sys.argv[4] != 'r':
- usage()
-
-segments = XenoUtil.lookup_disk_uname(sys.argv[1])
-
-if XenoUtil.vd_extents_validate(segments,writeable) < 0:
- print "That mapping is too unsafe for the current VBD expertise level"
- sys.exit(1)
-
-virt_dev = XenoUtil.blkdev_name_to_number(sys.argv[2])
-
-target_dom = int(sys.argv[3])
-
-xc.vbd_create(target_dom,virt_dev,writeable)
-
-if xc.vbd_setextents( target_dom, virt_dev, segments ):
- print "Error populating VBD vbd=%d\n" % virt_dev
- sys.exit(1)
-
-
-print "Added " + sys.argv[1] + " to domain " + sys.argv[3] + " as device " + sys.argv[2]
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# Example script for creating and building a new Linux guest OS for Xen.
-# It takes an optional parameter that specifies offsets to be added to the
-# ip address and root partition numbers, enabling multiple domains to be
-# started from the one script.
-#
-# Edit as required...
-#
-
-import Xc, XenoUtil, string, sys, os, time, socket
-
-# initialize a few variables that might come in handy
-thishostname = socket.gethostname()
-guestid = 0
-if len(sys.argv) >= 2:
- guestid = string.atoi(sys.argv[1])
- print "Offset to add to guest's IP etc : %d\n" % guestid
-
-##### This section of the code establishes various settings to be used
-##### for this guest virtual machine
-
-# STEP 1. Specify kernel image file. Can be gzip'ed.
-image = "../../../install/boot/xenolinux.gz"
-
-# STEP 2. How many megabytes of memory for the new domain?
-memory_megabytes = 64
-
-# STEP 3. A handy name for your new domain.
-domain_name = "This is VM %d" % guestid
-
-# STEP 4. Specify IP address(es), netmask and gateway for the new
-# domain. You need to configure IP addrs within the domain just as
-# you do normally. This is just to let Xen know about them so it can
-# route packets appropriately.
-
-#ipaddr = ["111.222.333.444","222.333.444.555"]
-ipaddr = [XenoUtil.add_offset_to_ip(XenoUtil.get_current_ipaddr(),guestid)]
-netmask = XenoUtil.get_current_ipmask()
-gateway = XenoUtil.get_current_ipgw()
-nfsserv = '169.254.1.0' # You need to set this if you're using NFS root
-
-# STEP 5. Identify any physcial partitions or virtual disks you want the
-# domain to have access to, and what you want them accessible as
-# e.g. vbds = [ ('phy:sda1','sda1', 'w'),
-# ('phy:sda4','sda%d' % (3+guestid), 'r'),
-# ('vd:as73gd784dh','hda1','w') ]
-
-vbds = [ ('phy:sda%d'%(7+guestid),'sda1','w' ),
- ('phy:sda6','sda6','r'),
- ('phy:cdrom','hdd','r') ]
-
-# STEP 5b. Set the VBD expertise level. Most people should leave this
-# on 0, at least to begin with - this script can detect most dangerous
-# disk sharing between domains and with this set to zero it will only
-# allow read only sharing.
-vbd_expert = 0
-
-# STEP 6. Build the command line for the new domain. Edit as req'd.
-# You only need the ip= line if you're NFS booting or the root file system
-# doesn't set it later e.g. in ifcfg-eth0 or via DHCP
-# You can use 'extrabit' to set the runlevel and custom environment
-# variables used by custom rc scripts (e.g. DOMID=, usr= )
-
-ipbit = "ip="+ipaddr[0]+":"+nfsserv+":"+gateway+":"+netmask+"::eth0:off"
-rootbit = "root=/dev/sda1 ro"
-#rootbit = "root=/dev/nfs nfsroot=/full/path/to/root/directory"
-extrabit = "4 DOMID=%d usr=/dev/sda6" % guestid
-cmdline = ipbit +" "+ rootbit +" "+ extrabit
-
-# STEP 7. Set according to whether you want the script to watch the domain
-# and auto-restart it should it die or exit.
-
-auto_restart = False
-#auto_restart = True
-
-
-##### Print some debug info just incase things don't work out...
-#####
-
-print "Domain image : ", image
-print "Domain memory : ", memory_megabytes
-print "Domain IP address(es) : ", ipaddr
-print "Domain block devices : ", vbds
-print 'Domain cmdline : "%s"' % cmdline
-
-
-##### Code beyond this point is actually used to manage the mechanics of
-##### starting (and watching if necessary) guest virtual machines.
-
-# Obtain an instance of the Xen control interface
-xc = Xc.new()
-
-# This function creates, builds and starts a domain, using the values
-# in the global variables, set above. It is used in the subsequent
-# code for starting the new domain and rebooting it if appropriate.
-def make_domain():
- """Create, build and start a domain.
- Returns: [int] the ID of the new domain.
- """
-
- # set up access to the global variables declared above
- global image, memory_megabytes, domain_name, ipaddr, netmask
- global vbds, cmdline, xc, vbd_expert
-
- if not os.path.isfile( image ):
- print "Image file '" + image + "' does not exist"
- sys.exit()
-
- id = xc.domain_create( mem_kb=memory_megabytes*1024, name=domain_name )
- print "Created new domain with id = " + str(id)
- if id <= 0:
- print "Error creating domain"
- sys.exit()
-
- ret = xc.linux_build( dom=id, image=image, cmdline=cmdline )
- if ret < 0:
- print "Error building Linux guest OS: "
- print "Return code from linux_build = " + str(ret)
- xc.domain_destroy ( dom=id )
- sys.exit()
-
- # setup the virtual block devices
-
- # set the expertise level appropriately
- XenoUtil.VBD_EXPERT_MODE = vbd_expert
-
- for ( uname, virt_name, rw ) in vbds:
- virt_dev = XenoUtil.blkdev_name_to_number( virt_name )
-
- segments = XenoUtil.lookup_disk_uname( uname )
- if not segments:
- print "Error looking up %s\n" % uname
- xc.domain_destroy ( dom=id )
- sys.exit()
-
- # check that setting up this VBD won't violate the sharing
- # allowed by the current VBD expertise level
- if XenoUtil.vd_extents_validate(segments, rw=='w') < 0:
- xc.domain_destroy( dom = id )
- sys.exit()
-
- if xc.vbd_create( dom=id, vbd=virt_dev, writeable= rw=='w' ):
- print "Error creating VBD vbd=%d writeable=%d\n" % (virt_dev,rw)
- xc.domain_destroy ( dom=id )
- sys.exit()
-
- if xc.vbd_setextents( dom=id,
- vbd=virt_dev,
- extents=segments):
- print "Error populating VBD vbd=%d\n" % virt_dev
- xc.domain_destroy ( dom=id )
- sys.exit()
-
- # setup virtual firewall rules for all aliases
- for ip in ipaddr:
- XenoUtil.setup_vfr_rules_for_vif( id, 0, ip )
-
- if xc.domain_start( dom=id ) < 0:
- print "Error starting domain"
- xc.domain_destroy ( dom=id )
- sys.exit()
-
- return id
-# end of make_domain()
-
-
-
-# The starting / monitoring of the domain actually happens here...
-
-# start the domain and record its ID number
-current_id = make_domain()
-
-# if the auto_restart flag is set then keep polling to see if the domain is
-# alive - restart if it is not by calling make_domain() again (it's necessary
-# to update the id variable, since the new domain may have a new ID)
-
-while auto_restart:
- time.sleep(1)
- if not xc.domain_getinfo(current_id):
- print "The virtual machine has terminated, restarting in a new domain"
- current_id = make_domain()
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# Destroy specified domain.
-#
-
-import Xc, sys, re
-
-xc = Xc.new()
-
-if len(sys.argv) < 2:
- print "Specify a domain identifier"
- sys.exit()
-
-if (len(sys.argv) > 2) and re.match( 'force', sys.argv[2] ):
- xc.domain_destroy( dom=int(sys.argv[1]), force=1 )
-else:
- xc.domain_destroy( dom=int(sys.argv[1]), force=0 )
+++ /dev/null
-#!/usr/bin/env python
-
-
-import Xc, sys
-
-xc = Xc.new()
-
-print xc.vbd_probe()
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# List info on all domains.
-#
-
-import Xc, sys
-xc = Xc.new()
-print xc.domain_getinfo()
-
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# Destroy specified domain.
-#
-
-import Xc, sys, re, time
-
-xc = Xc.new()
-
-if len(sys.argv) < 3:
- print "Specify a domain identifier and CPU"
- sys.exit()
-
-dom = int(sys.argv[1])
-cpu = int(sys.argv[2])
-
-orig_state = xc.domain_getinfo(first_dom=dom, max_doms=1)[0]['stopped']
-
-while xc.domain_getinfo(first_dom=dom, max_doms=1)[0]['stopped'] != 1:
- xc.domain_stop( dom=dom )
- time.sleep(0.1)
-
-xc.domain_pincpu( dom, cpu )
-
-if orig_state == 0:
- xc.domain_start( dom=dom )
-
-
-
-
+++ /dev/null
-#!/usr/bin/env python
-
-# Copyright (C) 2003 by Intel Research Cambridge
-
-# File: tools/examples/readconsolering.py
-# Author: Mark A Williamson (mark.a.williamson@intel.com)
-# Date: 2003-12-02
-
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-
-
-"""Reads out the contents of the console ring
-
-Usage: readconsolering.py [-c]
-The -c option causes the contents to be cleared.
-"""
-
-import sys, Xc # import the Xc Xen Control module
-
-xc = Xc.new() # get a new instance of the control interface
-
-clear_buffer = False
-
-if sys.argv[1:] != []:
- if sys.argv[1] == "-c":
- clear_buffer = True
- else:
- print >> sys.stderr, "Usage: " + sys.argv[0] + """ [-c]
- Reads the contents of the console buffer.
- (specifying -c will also clear current contents)"""
-
-# Get the console ring's contents as a string and print it out.
-# If argument to readconsolering is true then the buffer is cleared as well as
-# fetching the (pre-clearing) contents.
-print xc.readconsolering(clear_buffer)
+++ /dev/null
-#!/usr/bin/env python
-
-# Used to map a VBD into a domain's device space. Useful for populating a new
-# VBD with data from DOM0 before starting a new domain using it, for instance.
-
-# Usage: add_vdisk_to_dom.py uname target-dev-name target-dom-number
-# uname - the uname of the device, e.g. vd:2341 or phy:hda3
-# target-dev-name - the device node to map the VBD to
-# target-dom-number - domain to add the new VBD to
-
-import Xc, XenoUtil, sys
-
-xc = Xc.new()
-
-if len(sys.argv) != 3:
- print >>sys.stderr,"""Usage: add_vdisk_to_dom.py target-dev target-dom
- target-dev - the device node the VBD is mapped to
- target-dom - domain to remove the VBD from"""
- sys.exit(1)
-
-virt_dev = XenoUtil.blkdev_name_to_number(sys.argv[1])
-
-target_dom = int(sys.argv[2])
-
-if not xc.vbd_destroy(target_dom,virt_dev):
- print "Removed " + sys.argv[1] + " from domain " + sys.argv[2]
-else:
- print "Failed"
- sys.exit(1)
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# Start execution of specified domain.
-#
-
-import Xc, sys, re
-
-xc = Xc.new()
-
-if len(sys.argv) != 2:
- print "Specify a domain identifier"
- sys.exit()
-
-xc.domain_start( dom=int(sys.argv[1]) )
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# Stop execution of specified domain.
-#
-
-import Xc, sys, re
-
-xc = Xc.new()
-
-if len(sys.argv) != 2:
- print "Specify a domain identifier"
- sys.exit()
-
-xc.domain_stop( dom=int(sys.argv[1]) )
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# Wrapper script for creating a virtual disk.
-#
-# Usage: vd_create.py size [expiry]
-#
-
-import XenoUtil, sys
-
-if len(sys.argv) > 1:
- size = int(sys.argv[1])
-else:
- print "Usage: " + sys.argv[0] + """ size [expiry]
- Allocates a Virtual Disk out of the free space pool. An expiry time
- can be specified in seconds from now (0 means never expire) - the default
- is for disks to never expire."""
- sys.exit(1)
-
-if len(sys.argv) > 2:
- expiry_time = int(sys.argv[2])
-else:
- print "No expiry time specified - using default\n"
- expiry_time = 0
-
-print "Creating a virtual disk"
-print "Size: %d" % size
-print "Expiry time (seconds from now): %d" % expiry_time
-
-ret = XenoUtil.vd_create(size, expiry_time)
-
-if ret < 0:
- print >> sys.stderr, "An error occurred creating the the disk"
- sys.exit(ret)
-else:
- print "Virtual disk allocated, with ID: " + ret
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# Wrapper script for deleting a virtual disk.
-#
-# Usage: vd_create.py id
-#
-
-import sys, XenoUtil
-
-if len(sys.argv) > 1:
- id = sys.argv[1]
-else:
- print "Usage: " + sys.argv[0] + """ id
- Deletes a virtual disk."""
- sys.exit(1)
-
-print "Deleting a virtual disk with ID: " + id
-
-ret = XenoUtil.vd_delete(id)
-
-if ret:
- print "Deletion failed: invalid ID, or disk already expired / deleted"
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# Wrapper script for formatting a device to host Xen virtual disk extents
-#
-# Usage: vd_format.py device [extent_size]
-#
-
-import sys, XenoUtil
-
-if len(sys.argv) > 1:
- device = sys.argv[1]
-else:
- print "Usage: " + sys.argv[0] + """ device [extent_size]
- Formats a device to host Xen virtual disk extents. The extent size can
- optionally be specified in megabytes (default 64MB)."""
- sys.exit(1)
-
-if len(sys.argv) > 2:
- extent_size = int(sys.argv[2])
-else:
- print """No extent size specified - using default size
- (for really small devices, the default size of 64MB might not work)"""
- extent_size = 64
-
-print "Formatting for virtual disks"
-print "Device: " + sys.argv[1]
-print "Extent size: " + str(extent_size) + "MB"
-
-ret = XenoUtil.vd_format(device, extent_size)
-
-if ret:
- print >> sys.stderr, "An error occurred formatting the device"
- sys.exit(ret)
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# vd_freespace.py
-#
-# Prints out the amount of free space (in megabytes) for creating virtual disks.
-#
-
-import XenoUtil
-
-print XenoUtil.vd_freespace()
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# vd_list.py - use this to list all the unexpired virtual disks in the
-# virtual disk database
-#
-
-import XenoUtil
-
-print XenoUtil.vd_list()
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# vd_read_from_file.py filename
-#
-# Reads a virtual disk in from a file and allocates a VD (prints out its ID)
-#
-
-import XenoUtil, sys
-
-if len(sys.argv) < 2:
- print "Usage: " + sys.argv[0] + """ filename [expiry]
- Reads in a virtual disk form a file and allocates a VD.
- Can optionally set the expiry time in seconds from now
- (default - don't expire)
- """
- sys.exit()
-
-if len(sys.argv) > 2:
- expiry = int(sys.argv[2])
-else:
- expiry = 0
-
-ret = XenoUtil.vd_read_from_file(sys.argv[1], expiry)
-
-if ret < 0:
- print "Operation failed"
-else:
- print "File " + sys.argv[1] + " read into virtual disk ID " + ret
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# Wrapper script for creating a virtual disk.
-#
-# Usage: vd_refresh.py id [new-expiry]
-#
-
-import sys, XenoUtil
-
-if len(sys.argv) > 1:
- id = sys.argv[1]
-else:
- print "Usage: " + sys.argv[0] + """ ID [expiry-new]
- Refreshes a Virtual Disk expiry time. An expiry time
- can be specified in seconds from now (0 means never expire) - the default
- is for disks to never expire."""
- sys.exit(1)
-
-if len(sys.argv) > 2:
- expiry_time = int(sys.argv[2])
-else:
- print "No expiry time specified - using default\n"
- expiry_time = 0
-
-print "Refreshing a virtual disk"
-print "Id: " + sys.argv[1]
-print "Expiry time (seconds from now): " + sys.argv[2]
-
-ret = XenoUtil.vd_refresh(id, expiry_time)
-
-if ret:
- print "Refresh failed, non-existent virtual disk or disk is expired / deleted"
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# vd_to_file.py filename [-m]
-#
-# Writes a virtual disk out to a file. Optionally, the "-m" (move)
-# flag causes the virtual disk to be deallocated once its data is
-# read out.
-
-import XenoUtil, sys
-
-def usage():
- print "Usage: " + sys.argv[0] + """ vdisk_id filename [-m]
- Writes a virtual disk out to a file. Optionally, the "-m" (move)
- flag causes the virtual disk to be deallocated once its data is
- read out.
- """
- sys.exit()
-
-if not 3 <= len(sys.argv) <= 4:
- usage()
-
-if len(sys.argv) == 4:
- if sys.argv[3] != "-m":
- usage()
- else:
- print "Doing move to file..."
- if XenoUtil.vd_mv_to_file(sys.argv[1],sys.argv[2]):
- print "Failed"
-else:
- print "Doing copy to file..."
- if XenoUtil.vd_cp_to_file(sys.argv[1], sys.argv[2]):
- print "Failed"
-
+++ /dev/null
-#!/usr/bin/env python
-
-#
-# vd_undelete.py vdisk_id [ new_expiry ]
-#
-# Undeletes a VD and, optionally, sets a new expiry time or disables
-# expiry if the time value is zero (default)
-#
-
-import XenoUtil, sys
-
-if len(sys.argv) < 2:
- print >>sys.stderr, "Usage: " + sys.argv[0] + """ vdisk_id [ new_expiry ]
- vdisk_id - the identifier of the deleted VD
- new_expiry - optionally the new expiry time in seconds from now (0
- for never expire - which is the default)
-
- VDs can currently only be undeleted if it is safe to do so,
- i.e. if none of their space has been reallocated.
- """
-
-vdisk_id = sys.argv[1]
-
-if len(sys.argv) == 3:
- expiry = int(sys.argv[2])
-else:
- expiry = 0
-
-if XenoUtil.vd_undelete(vdisk_id, expiry):
- print "Undelete operation failed for virtual disk: " + vdisk_id
-else:
- print "Undelete operation succeeded for virtual disk: " + vdisk_id
+++ /dev/null
-/******************************************************************************
- * xen_refresh_dev.c
- *
- * Refresh our view of a block device by rereading its partition table. This
- * is necessary to synchronise with VBD attaches and unattaches in Xen.
- * Currently there's no automatic plumbing of attach/unattach requests.
- *
- * Copyright (c) 2003, K A Fraser
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/mount.h> /* BLKRRPART */
-
-int main(int argc, char **argv)
-{
- int fd;
-
- if ( argc != 2 )
- {
- fprintf(stderr, "xen_refresh_dev <blkdev>\ne.g., /dev/xvda\n");
- return 1;
- }
-
- if ( (fd = open(argv[1], O_RDWR)) == -1 )
- {
- fprintf(stderr, "Error opening %s: %s (%d)\n",
- argv[1], strerror(errno), errno);
- return 1;
- }
-
- if ( ioctl(fd, BLKRRPART) == -1 )
- {
- fprintf(stderr, "Error executing BLKRRPART on %s: %s (%d)\n",
- argv[1], strerror(errno), errno);
- return 1;
- }
-
- close(fd);
-
- return 0;
-}